<template>
  <div id="basicLayout">
    <a-layout style="min-height: 100vh">
      <!--      头部-->
      <a-layout-header style="margin-bottom: 28px; background: linear-gradient(to right, #fefefe, #fff);padding-inline: 20px;color: unset;
box-shadow: 0 0 4px  #999">
        <GlobalHeader />
      </a-layout-header>

      <!--      中间-->
      <a-layout>
        <GlobalSider class="sider" />
        <a-layout-content class="content">
          <router-view v-if="isRouterAlive" />
        </a-layout-content>
      </a-layout>


      <!--      底部-->
      <a-layout-footer class="footer">
        <a href="http://localhost:5173/" target="_blank">
          智能云图库 李yoy
        </a>
      </a-layout-footer>

    </a-layout>
  </div>
</template>

<script setup lang="ts">
import GlobalHeader from '@/components/GlobalHeader.vue'
import { ref, nextTick, provide } from 'vue'
import GlobalSider from '@/components/GlobalSider.vue'

const isRouterAlive = ref(true)
// 定义一个 reload 函数
const reload = () => {
  isRouterAlive.value = false
  nextTick(() => {
    isRouterAlive.value = true
  })
}
provide('reload', reload)


</script>

<style scoped>


#basicLayout .footer {
  background: #efefef;
  padding: 16px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
}

#basicLayout .content {
  background: linear-gradient(to right, #fefefe, #fff);
  margin-bottom: 28px;
  padding: 20px;
}

#basicLayout .header {
  margin-bottom: 1px;
}

#basicLayout .content {
  padding: 28px;
}

#basicLayout .sider {
  background: #fff;
  padding-top: 20px;
  border-right: 0.5px solid #eee;
}

#basicLayout :deep(.ant-menu-root) {
  border-bottom: none !important;
  border-inline-end: none !important;
}

</style>
